using System.Linq;
namespace LinqToSql
{
    partial class Employee
    {
        public void GetTerritories()
        {
            NorthwindDataClassesDataContext context = new NorthwindDataClassesDataContext();
            using (context)
            {
                var territories = 
                    from et in context.EmployeeTerritories                   
                    join t in context.Territories on et.TerritoryID equals t.TerritoryID
                    where et.EmployeeID == this.EmployeeID
                    select t;

                foreach (var ter in territories)
                {
                    System.Console.WriteLine(ter.TerritoryDescription);
                }
            }
        }
    }
}
